# Maintainer: Bruno Pagani <archange@archlinux.org>

_pkg=PyVirtualDisplay
pkgname=python-${_pkg,,}
pkgver=3.0
pkgrel=3
pkgdesc="Python wrapper for Xvfb, Xephyr and Xvnc"
arch=(any)
url="https://github.com/ponty/PyVirtualDisplay"
license=(BSD)
depends=(python)
makedepends=(python-setuptools)
checkdepends=(
    python-pytest python-pytest-xdist
    python-pyscreenshot python-pillow python-easyprocess
    python-entrypoint2 python-path.py python-psutil
    xorg-server-xvfb xorg-server-xephyr
    xorg-xmessage xorg-xdpyinfo scrot vncdotool
)
source=(https://files.pythonhosted.org/packages/source/${_pkg::1}/${_pkg}/${_pkg}-${pkgver}.tar.gz)
#source=(${url}/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha256sums=('09755bc3ceb6eb725fb07eca5425f43f2358d3bf08e00d2a9b792a1aedd16159')

build() {
  cd ${_pkg}-${pkgver}
  python setup.py build
}

check() {
  cd ${_pkg}-${pkgver}
  PYTHONPATH="${PWD}"/build/lib pytest -vv --color=yes tests
}

package() {
  cd ${_pkg}-${pkgver}
  python setup.py install --prefix=/usr --root="${pkgdir}" --skip-build --optimize=1
  install -Dm644 LICENSE.txt -t "${pkgdir}"/usr/share/licenses/${pkgname}
}
